package viewControllers.robot;

import graphics.GraphicalObject;
import viewControllers.AnimationPart;

public class Leg extends AnimationPart{

	double angle_frame =  0.1;
	double angle_limit = Math.PI / 6; 
	double angle = 0;
	int direction = 1;
	
	public Leg(GraphicalObject object) {
		super(object);
	}

	@Override
	public void play(int frame) {
		if (angle > angle_limit)
			direction = -1;
		if (angle < -angle_limit)
			direction = 1;
		angle += angle_frame * direction;
		position.rotateNormal(angle_frame * direction, 0, 0);
	}

}
